﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CafeApp.Service;

namespace CafeApp.Controllers
{
    public class HomeController : Controller
    {
        DM_DAYBAN_SERVICE _dm_day_Ser = new DM_DAYBAN_SERVICE();
        DM_BAN_SERVICE _dm_ban_Ser = new DM_BAN_SERVICE();

        public ActionResult Index()
        {
            var listEntity = _dm_day_Ser.GetList();
            return View(listEntity);
        }

        public ActionResult GetListBanInDay(int maDay, int cot)
        {
            var listEntity = _dm_ban_Ser.GetListByDay(maDay);
            ViewBag.cotBan = cot;
            ViewBag.soluongsanpham = listEntity.Count() / cot;
            return PartialView("_GetListBanInDay", listEntity);
        }
    }
}
